<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0" />
    <title>美策平台</title>
    <link rel="icon" type="image/png" href="/img/icon.png">
    <link rel="stylesheet" type="text/css" href="../datepicker/jquery-ui.min.css">
    <link rel="stylesheet" type="text/css" href="../css/app.css">
    <link rel="stylesheet" type="text/css" href="../css/my.css">
    <script type="text/javascript" src="../js/jquery.min.js"></script>
    <script type="text/javascript" src="/pc/js/all.js"></script>
</head>
<body>
<!--
    制作者：九哥
    页面：我的设置
    时间：2019-03-23
    更新：
-->





<!---------- 我的设置 ---------->
<div id="settingPage">
    <div id="settingTitle">
        <b>我的设置</b>
        <img src="../images/return.png" id="settingRtn">
    </div>
    <div class="myTable">
        <a href="setting/info.html">
            <div class="table-box">
                <div class="tableTitle">我的信息</div>
                <div class="arrow-box">
                    <b class="right">
                        <i class="right-arrow1"></i>
                        <i class="right-arrow2"></i>
                    </b>
                </div>
            </div>
        </a>
        <!--<hr>-->
        <!--<a href="">-->
            <!--<div class="table-box">-->
                <!--<div class="tableTitle">我的收货地址</div>-->
                <!--<div class="arrow-box">-->
                    <!--<b class="right">-->
                        <!--<i class="right-arrow1"></i>-->
                        <!--<i class="right-arrow2"></i>-->
                    <!--</b>-->
                <!--</div>-->
            <!--</div>-->
        <!--</a>-->
        <hr>
        <a href="setting/pwd.html">
            <div class="table-box">
                <div class="tableTitle">修改登录密码</div>
                <div class="arrow-box">
                    <b class="right">
                        <i class="right-arrow1"></i>
                        <i class="right-arrow2"></i>
                    </b>
                </div>
            </div>
        </a>
    </div>
    <div style="height:10px"></div>
    <div class="myTable">
        <!--<a href="javascript:;" onclick="getErrMsg('更新待接入','')">-->
            <!--<div class="table-box">-->
                <!--<div class="tableTitle">检测更新</div>-->
                <!--<div class="arrow-box">-->
                    <!--<b class="right">-->
                        <!--<i class="right-arrow1"></i>-->
                        <!--<i class="right-arrow2"></i>-->
                    <!--</b>-->
                <!--</div>-->
            <!--</div>-->
        <!--</a>-->
        <!--<hr>-->
        <!--<a href="javascript:;" onclick="getErrMsg('缓存待接入','')">-->
        <a href="setting/cache.html">
            <div class="table-box">
                <div class="tableTitle">缓存管理</div>
                <div class="arrow-box">
                    <b class="right">
                        <i class="right-arrow1"></i>
                        <i class="right-arrow2"></i>
                    </b>
                </div>
            </div>
        </a>
    </div>
    <div style="height:10px"></div>
    <div class="myTable">
        <a href="javascript:;">
            <div class="table-box">
                <div class="tableTitle">
                    检测更新
                    <span id="version" style="font-size:12px;"></span>
                </div>
                <div class="arrow-box">
                    <b class="right">
                        <i class="right-arrow1"></i>
                        <i class="right-arrow2"></i>
                    </b>
                </div>
            </div>
        </a>
    </div>
    <div style="height:10px;display:none;" class="userNotice"></div>
    <div class="myTable userNotice" style="display:none;">
        <a href="../ios/userNotice.html">
            <div class="table-box">
                <div class="tableTitle">
                    用户须知
                </div>
                <div class="arrow-box">
                    <b class="right">
                        <i class="right-arrow1"></i>
                        <i class="right-arrow2"></i>
                    </b>
                </div>
            </div>
        </a>
    </div>
    <div style="height:10px"></div>
    <div class="myTable">
        <a href="javascript:;" onclick="getlogoutPop()">
            <div class="table-box">
                <div class="tableTitle" style="color:#0088cc;">退出登录</div>
                <div class="arrow-box">
                    <b class="right">
                        <i class="right-arrow1"></i>
                        <i class="right-arrow2"></i>
                    </b>
                </div>
            </div>
        </a>
    </div>
</div>
<!---------- 我的设置 ---------->





<!-----------提示信息---------->
<div id="pop">
    <div id="popMask"></div>
    <div id="popDetail">
    </div>
</div>
<!-----------提示信息---------->

<!----------错误提示---------->
<div id="errMsg"></div>
<!----------错误提示---------->
</body>
<script type="text/javascript" src="../js/cache.js"></script>
<script type="text/javascript" src="../js/app.js"></script>
<script type="text/javascript" src="../js/mysetPageChange.js"></script>
<script type="text/javascript" src="../js/myset.js"></script>
</html>

<script>
    (function(){
        getAppVersion(); //新版本请求
        getUserNotice(); //用户须知
    })();
    /**
     * 新版本请求
     * */
    function getAppVersion(){
        //获取APP标识，安卓/IOS
        var appIndentity;
        var u = navigator.userAgent;
//        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
//        var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
        if (u.indexOf('Android') > -1 || u.indexOf('Adr') > -1) {
            appIndentity = 'android';
        } else if (!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)) {
            appIndentity = 'ios';
        } else {
            appIndentity = 'undefined';
        }
        var fomrData = {
            app_access:app_access,
            appIndentity:appIndentity
        };
        $.ajax({
            type:'get',
            url:getDomain(),
            data:fomrData,
            success:function(res){
                //console.log(res)
                if (res.code!=0) {
                    console.log('没有新版本！');
                    //getAppErrMsg(res.msg,'',0);
                    $('#version').html('当前是最新版本');
                    return
                }
                var resVersion = res.data.version;
                var resUrl = res.data.url;
                var localVersion = getLocalVersion();
                if (resVersion > localVersion) {
                    getAppErrMsg(version,'',0);
                    var version = '有新版本：' + resVersion + '，点击去更新';
                    var url = resUrl ? resUrl : 'javascript:;';
                    var h = '<span style="color:red;" onclick="'+url+'">'+version+'</span>';
                    $('#version').html(h);
                    return
                }
            },
            error:function(){
                console.log('操作失败！'); return
            }
        });
    }
    /**
     * 用户须知
     * */
    function getUserNotice(){
        var userInfo = cacheGet('userInfo');
        var userNotice = userInfo.userNotice;
        if (userNotice==1) {
            $('.userNotice').hide();
        } else {
            $('.userNotice').show();
        }
    }
    //请求地址
    function getDomain(){
        return '/api/app/version';
    }
</script>